/******************************************************************************
 * Project: Processor Affinity Manager                                        *
 * File:    Default.cs                                                        *
 * Author:  Aaron Jones                                                       *
 * Version: 1                                                                 *
 *                                                                            *
 * Description:                                                               *
 *    This file conains the class representing a preset processor affinity    *
 *    default.  Conceptually, a default consists of a way to identify the     *
 *    process the default is applied to (the path the executable), and a      *
 *    representation of the processor affinity to be applied (a bitmap where  *
 *    each bit represents a processor).  No parameter validation is performed *
 *    at this level.                                                          *
 ******************************************************************************/
 
using System;

namespace ProcessorAffinityManager
{
    [Serializable]
    public class Default
    {
        /// <summary>
        /// The path to the executable file this default will be applied to.
        /// </summary>
        public string ExecutablePath = null;

        /// <summary>
        /// A bitmap representing the processor affinity to be applied.
        /// Lower bit significances represent lower processor numbers
        /// to the operating system.  (i.e. a value of 1 represents processor
        /// 0, a value of 2 represents processor 1, a value of 3 represents
        /// both processors 0 and 1, etc.
        /// </summary>
        public int ProcessorAffinity = 0;

        public Default()
        {
        }

        /// <summary>
        /// Constructor that allows client initialization of all members.
        /// </summary>
        /// <param name="executablePath">
        /// The path to the executable file this default will be applied to.
        /// </param>
        /// <param name="processorAffinity">
        /// A bitmap representing the processor affinity to be applied.
        /// Lower bit significances represent lower processor numbers
        /// to the operating system.  (i.e. a value of 1 represents processor
        /// 0, a value of 2 represents processor 1, a value of 3 represents
        /// both processors 0 and 1, etc.
        /// </param>
        public Default(string executablePath, int processorAffinity)
        {
            ExecutablePath = executablePath;
            ProcessorAffinity = processorAffinity;
        }
    }
}
